package day4.liberary.operator;

import day4.liberary.book1.booklist;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: watermelon
 * Date: 2025-05-30
 * Time: 23:13
 */
public class borrowed implements Job{
    @Override
    public void working(booklist list) {
        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入需要借阅的书名");
        String bookname=scanner.next();
        for (int i = 0; i < list.capacity; i++) {
            if(list.booklist[i].getName().equals(bookname))
            {
                list.booklist[i].setIsborrowed(true);
                list.browbook=list.booklist[i].getName();
                break;
            }
            if(i== list.capacity-1)
            {
                System.out.println("没有该图书");
            }
        }
    }
}
